/*
 * Particle.h
 *
 *  Created on: 2009/02/17
 *      Author: Yongshik Cho
 */

#ifndef PARTICLE_H_
#define PARTICLE_H_

#include <vector>
#include "core/Prerequisites.h"
#include "core/Vector3D.h"


// sub-block in block E - animation data
struct AnimationBlock
{
public:
	int16 type;		// interpolation type (0=none, 1=linear, 2=hermite)
	int16 seq;		// global sequence id or -1
	vector<uint32> ranges;
	vector<uint32> times;
	vector<uint32> keys;
};

struct ParticleParams
{
public:
	float mid;
	uint32 colors[3];
	float sizes[3];
	int16 d[10];
	float unk[3];
	float scales[3];
	float slowdown;
	float rotation;	//Sprite Rotation
	float unknown;
	float Rot1[3];	//Model Rotation 1
	float Rot2[3];	//Model Rotation 2
	float Trans[3];	//Model Translation
	float f2[6];
};

struct ParticleEmitterDef
{
public:
	int32 id;
	int32 flags;
	Vector3D pos;
	int16 bone;
	int16 texture;
	int32 nModelName;
	int32 ofsModelName;
	int32 nZero2;
	int32 ofsZero2;
	int16 blend;
	int16 type;
	int16 s1;
	int16 s2;
	int16 cols;
	int16 rows;
	AnimationBlock params[10];
	ParticleParams p;
	AnimationBlock en;
};

struct RibbonEmitterDef
{
	int32 id;
	int32 bone;
	Vector3D pos;
	int32 nTextures;
	int32 ofsTextures;
	int32 nUnknown;
	int32 ofsUnknown;
	AnimationBlock color;
	AnimationBlock opacity;
	AnimationBlock above;
	AnimationBlock below;
	float res, length, unk;
	int16 s1, s2;
	AnimationBlock unk1;
	AnimationBlock unk2;
};


#endif /* PARTICLE_H_ */
